package game.tileMap.model.vo
{
	public class ActorVo
	{
		public var id:int
	    public var name:String,battler_name:String
	    public var battler_hue:Number;
	    public var maxhp:int
	    public var maxmp:int
	    public var atk:Number,def:Number
	    public var spi:Number;
	    public var agi:Number,hit:Number,eva:Number;
	   
	    public var exp:Number;
	    public var gold:Number
	    public var drop_item1:XML,drop_item2:XML
	    public var levitate:Boolean
	    public var has_critical:Boolean
	    public var element_ranks:XML
	    public var state_ranks:XML
	    public var actions:XML
	    public var note:String;
		public var skills:Array;
		public function ActorVo(xml:XML){
			init(xml)
		}
		
		private function init(data:XML):void{
			id = data.id;
		    name = data.name
		    battler_name = data.battler_name
		    battler_hue = data.battler_hue
		    maxhp = data.maxhp
		    maxmp = data.maxmp
		    atk = data.atk
		    def = data.def
		    spi = data.spi
		    agi = data.agi
		    hit = data.hit
		      eva = data.eva
		      exp = data.exp
		      gold = data.gold
		      drop_item1 = data.drop_item[0]
		      drop_item2 = data.drop_item[1]
		      levitate = Boolean(data.levitae);
		      has_critical = Boolean(data.has_critical);
		    //  element_ranks = data.element_ranks;
		    //  state_ranks = data.state_ranks;
		   //   actions = data.actions;
		      note = data.note
			skills=splitToArray(data.skills);

		}
		
		private function splitToArray(str:String):Array{
			var arr:Array=[];
			if (str){
				var tempArr:Array=str.split(",");
				for each(var state_id:int in tempArr){
					arr.push(state_id);
				}
			}
			
			return arr;
		}
	}
}